<!DOCTYPE html>
<html lang="zh">
<head>
    <:include file="../../common/css.html" title="通知组件(过时)"/>
</head>
<body class="pear-container">
    <div>
        <div class="layui-row layui-col-space10">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">开发环境</div>
                    <div class="layui-card-body">
                        Notice 用于 消息通知 场景
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-collapse">
                    <div class="layui-colla-item">
                        <h2 class="layui-colla-title">显示代码</h2>
                        <div class="layui-colla-content">
                            <pre class="layui-code" lay-encode="true">
<link rel="stylesheet" href="/assets/component/pear/css/pear.css" />
 或
<link rel="stylesheet" href="/assets/component/pear/css/module/notice.css" />
 并
<script src="/assets/component/layui/layui.js"></script>
 并
<script src="/assets/component/pear/pear.js"></script>
                            </pre>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">消息提醒</div>
                    <div class="layui-card-body">
                        <div>
                            <span>notice.success("成功消息")</span>
                            <br>
                            <br>
                            <span>notice.error("危险消息")</span>
                            <br>
                            <br>
                            <span>notice.warning("警告消息")</span>
                            <br>
                            <br>
                            <span>notice.info("通用消息")</span>
                            <br>
                            <br>
                        </div>
                        <button class="notice-info pear-btn pear-btn-primary">通用消息</button>
                        <button class="notice-success pear-btn pear-btn-success">成功消息</button>
                        <button class="notice-failure pear-btn pear-btn-danger">错误消息</button>
                        <button class="notice-warning pear-btn pear-btn-warming">警告消息</button>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-collapse">
                    <div class="layui-colla-item">
                        <h2 class="layui-colla-title">显示代码</h2>
                        <div class="layui-colla-content">
                            <pre class="layui-code" lay-encode="true">
layui.use(['notice', 'jquery', 'layer', 'code'], function() {
    var notice = layui.notice;

    notice.success("成功消息")
    notice.error("危险消息")
    notice.warning("警告消息")
    notice.info("通用消息")
})
                            </pre>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        消息移除
                    </div>
                    <div class="layui-card-body">
                        <button class="pear-btn" id="closeAll">移除全部</button>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-collapse">
                    <div class="layui-colla-item">
                        <h2 class="layui-colla-title">显示代码</h2>
                        <div class="layui-colla-content">
                            <pre class="layui-code" lay-encode="true">
layui.use(['notice', 'jquery', 'layer', 'code'], function() {
    var notice = layui.notice;

    notice.clear();
})
                            </pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 依 赖 脚 本 -->
    <:include file="../../common/js.html" />
    <script>
        layui.use(['notice', 'jquery', 'layer', 'code', 'element'], function() {
            var notice = layui.notice;
            var layer = layui.layer;
            var $ = layui.jquery;

            layui.code({ encode: true  });

            notice.warning("成功消息");
            notice.info("提示消息");
            notice.error("错误消息");
            notice.success("成功消息");

            $(".notice-success").click(function() {
                notice.success("成功消息")
            })
            $(".notice-failure").click(function() {
                notice.error("危险消息")
            })
            $(".notice-warning").click(function() {
                notice.warning("警告消息")
            })

            $(".notice-info").click(function() {
                notice.info("通用消息")
            })

            $("#closeAll").click(function() {
                notice.clear();
            });

        });
    </script>
</body>
</html>
